import axios from 'axios'
import qs from 'qs'

const req = axios.create({
    baseURL: 'https://www.young1024.com:3002',
    method: 'post'
})

//请求拦截，处理请求参数
req.interceptors.request.use((config) => {
    config.data = qs.stringify(config.data)
    return config
})

//响应拦截，返回数据
req.interceptors.response.use((res) => {
    return res.data
})

export default req